//
//  BLActionSheet.h
//  EClub
//
//  Created by iBenz on 16/10/28.
//  Copyright © 2016年 EC. All rights reserved.
//

#import <UIKit/UIKit.h>
@class BLActionSheet;
@class BLActionSheetItem;
@protocol BLActionSheetDelegate <NSObject>
@optional
- (CGFloat)actionSheet:(BLActionSheet *)actionSheet heightForSheetAtIndex:(NSInteger)index;
- (BLActionSheetItem *)actionSheet:(BLActionSheet *)actionSheet sheetAtIndex:(NSInteger)index;
- (void)actionSheet:(BLActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;
@end


@interface BLActionSheet : UIView
@property(nonatomic, readonly) UILabel *titleLabel;
@property(nonatomic, weak) id<BLActionSheetDelegate> delegate;

- (instancetype)initWithTitle:(NSString *)title delegate:(id<BLActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
- (NSInteger)addButtonWithTitle:(NSString *)title;
- (NSInteger)addButtonItem:(BLActionSheetItem *)item;
- (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;
- (BLActionSheetItem *)buttonWithIndex:(NSInteger)index;
- (void)showInView:(UIView *)view;
@end



@interface BLActionSheetItem : UIButton
+ (instancetype)sheetItemWithTitle:(NSString *)title;
@end
